import { queryUser } from '../../services/user';
export default {
  namespace: 'user',
  state: {
    users: 1,
  },

  effects: {
    *queryUser({ payload }, { call, put }) {
      const { data } = yield call(queryUser, payload);
      yield put({ type: 'queryUserData', payload: data });
    },
  },

  reducers: {
    initVideo(state: any, payload: any) {
      return {
        ...state,
        users: state.users + 1,
      };
    },
    queryUserData(state: any, payload: any) {
      return {
        ...state,
        data: payload.payload,
      };
    },
  },
};
